package com.ultimatech.feign;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;

/**
 * Created by zhangleping on 2017/9/27.
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableHystrix
//@EnableHystrixDashboard
public class ServiceFeignApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceFeignApplication.class, args);
    }

//    @Configuration
//    @EnableResourceServer
//    protected class ResourceServerConfig extends ResourceServerConfigurerAdapter {
//
//        private Logger log= LoggerFactory.getLogger(ResourceServerConfig.class);
//
////    @Autowired
////    private ResourceServerTokenServices tokenServices;
//
//        @Override
//        public void configure(HttpSecurity http) throws Exception {
////        http.authorizeRequests().antMatchers(HttpMethod.GET, "/hello").authenticated();
//            //.antMatchers(HttpMethod.POST, "/foo").hasAuthority("FOO_WRITE");
//            //you can implement it like this, but I show method invocation security on write
//
//        }
//
//        @Override
//        public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
//            log.info("==========================Configuring ResourceServerSecurityConfigurer ");
////        resources.resourceId("oauth2-resource");
////        resources.tokenServices(tokenServices);
//        }
//    }

}
